<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
    #stopInherit { color: green }
</style>
<div id="host">
    <div id="stopInherit">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
    </div>
</div>
<script>
    test(() => {
        var root = host.attachShadow({mode: 'open'});
        root.innerHTML = '<div id="shadowDiv"><content></content></div>';
        host.offsetTop;
        root.querySelector("#shadowDiv").style.color = "red";
        assert_true(!!window.internals, "This test only works with --expose-internals-for-testing.");
        assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Inheritance propagation should stop at #stopInherit element.");
    }, "Inheritance propagation should not cause full subtree recalcs in flat-tree.");
</script>
